package jmine.tec.persist.schema.association.mappedby;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

@Entity
@Table(name = "LIST_OWNED")
@Documentation("TABELA LIST OWNED")
@SequenceGenerator(name = "SEQ_LOWNED", sequenceName = "SEQ_LOWNED")
public class ListOwned extends PersistableBusinessObject {

    private Long id;

    private ListOwner owner;

    public ListOwned() {
        this(null);
    }

    public ListOwned(Long id) {
        this.id = id;
    }

    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator = "SEQ_LOWNED")
    @Column(name = "COD_OWNED", nullable = false)
    @Documentation("CODIGO OWNED")
    public Long getId() {
        return this.id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the owner
     */
    @ManyToOne
    @Documentation("CODIGO DA ENTIDADE OWNER")
    @JoinColumn(name = "COD_OWNER")
    public ListOwner getOwner() {
        return this.owner;
    }

    /**
     * @param owner the owner to set
     */
    public void setOwner(ListOwner owner) {
        this.owner = owner;
    }

}
